package _6funcs

import "strings"

func Func() (name string, age int) {
	//var name string
	//var age int
	//name = "sdf"
	//age = 18
	return
}

// Func1 没有任何参数
func Func1() {

}

// Func2 有一个参数
func Func2(a int) {

}

// Func3 多个参数
func Func3(a int, b string) {

}

// Func4 多个参数，同一个类型
func Func4(a, b int) {

}

func Func6(a, b string) string {
	return "hello, world"
}

func Func6_1(string) string {
	return ""
}

func Func7(a, b string) (string, string) {
	return "Deng", "Ming"
}

func Func8() (name string, age int) {
	return "Daming", 18
}

func Func9() (name string, age int) {
	name = "daming"
	age = 18
	return
}

func Func9_1() (name string, age int) {
	name = "daming"
	age = 18
	return name, age
}

func Func10() (string, int) {
	var name string
	var age int
	return name, age
}

// 返回对应类型的零值
func Func11() (name string, age int) {
	return
}

func Func13(abc string) (string, int) {
	segs := strings.Split(abc, " ")
	return segs[0], len(segs)
}

func Func14(abc string) (first string, length int) {
	segs := strings.Split(abc, " ")
	first = segs[0]
	length = len(segs)
	return
}
